CMS / Coding / Master Section Integration
Master Section Integration
-
Admin side
Files
1. Download Source file click here
2. Extract the file
3. copy and paste the 'app' and 'resource' folder to the root of the project
Route
add routes to route/admin.php
use App\Http\Controllers\admin\MasterController; // masters Route::get('/master',[MasterController::class, 'index'])->name('admin.master'); Route::get('/master/form',[MasterController::class, 'form'])->name('admin.master.form'); Route::post('/master/save',[MasterController::class, 'save'])->name('admin.master.save'); Route::get('/master/status/{id}',[MasterController::class, 'status'])->name('admin.master.status'); Route::post('/master/priority', [MasterController::class, 'priority'])->name('admin.master.priority'); Route::delete('/master/delete',[MasterController::class, 'delete'])->name('admin.master.delete'); DB
masters
CREATE TABLE `masters` ( `id` bigint UNSIGNED NOT NULL, `title` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL, `priority` int DEFAULT NULL, `identifier` char(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `status` enum('1','0') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '1', `deleted_at` timestamp NULL DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Indexes for dumped tables -- -- -- Indexes for table `masters` -- ALTER TABLE `masters` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `masters` -- ALTER TABLE `masters` MODIFY `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT; Menu Items
INSERT INTO `admin_menus` ( `title`, `parent_id`, `admin_access`, `icon`, `admin_route`, `identifier`, `query_str`, `custom_fields`, `status`, `priority`, `deleted_at`, `created_at`, `updated_at`) VALUES ( 'Category', 7, '0', 'fas fa-address-book', 'admin.master', 'category', '', '{\"grid\":{\"header\":[\n {\"title\":\"Title\",\"field\":\"title\",\"type\":\"text\",\"width\":\"100%\"} \n ],\n \"top_tools\":[{\"title\":\"Add New\",\"route\":\"admin.pages.form\",\"type\":\"link\"},\n {\"title\":\"List All\",\"route\":\"admin.pages\",\"type\":\"link\"}\n ],\n \"right_tools\":[{\"title\":\"Edit\",\"route\":\"admin.pages.form\",\"type\":\"link\"},\n {\"title\":\"Delete\",\"route\":\"admin.pages.delete\",\"type\":\"delete\"},\n {\"title\":\"Status\",\"route\":\"admin.pages.status\",\"type\":\"status\"}]},\n\"form\":{\"data\":[{\"title\":\"Title\",\"field\":\"title\",\"type\":\"text\",\"col\":\"12\"}\n \n \n \n],\n\"top_tools\":[{\"title\":\"Add New\",\"route\":\"admin.pages.form\",\"type\":\"link\"},\n {\"title\":\"List All\",\"route\":\"admin.pages\",\"type\":\"link\"}], \n \"bottom_tools\":[{\"title\":\"Save\",\"route\":\"admin.pages.form\",\"type\":\"submit\"},\n {\"title\":\"Cancel\",\"route\":\"admin.pages\",\"type\":\"link\"}]\n}}', '1', 1, NULL, NULL, NULL); 1.admin_route should be admin.master for all sections
2. title and identifier should be unique for each sections